#include <unordered_map>
class Solution 
{
    bool hash[1024] = { 0 };
public:
    vector<int> intersection(vector<int>& nums1, vector<int>& nums2) 
    {
        vector<int>ret;
        for(auto x : nums1) hash[x] = true;
        for(auto x : nums2)
        {
            if(hash[x])
            {
                ret.push_back(x);
                hash[x] = false;
            }
        }
        return ret;
    }
};